import { jwtConstants } from '@/constants';
import { DynamicFollow } from '@/entity/dynamic-follow.entity';
import { DynamicLike } from '@/entity/dynamic-like.entity';
import { Dynamic } from '@/entity/dynamic.entity';
import { User } from '@/entity/user.entity';
import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { TypeOrmModule } from '@nestjs/typeorm';
import { UserController } from './user.controller';
import { UserService } from './user.service';

@Module({
  imports: [
    TypeOrmModule.forFeature([User, Dynamic, DynamicFollow, DynamicLike]),
    JwtModule.register({
      secret: jwtConstants.secret,
      signOptions: { expiresIn: '12h' },
    }),
  ],
  controllers: [UserController],
  providers: [UserService],
  exports: [UserService],
})
export class UserModule {}
